import paramiko  
  
# 创建SSH客户端  
ssh = paramiko.SSHClient()  
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())  
ssh.connect('10.10.3.32', username='screen', password='Bs@2021')  
  
# 创建SFTP客户端  
sftp = ssh.open_sftp()  
  
# 上传文件  
local_path = '../file/text.txt'  
remote_path = '/home/screen/temp20231117/file.txt'  
sftp.put(local_path, remote_path)  
  
# 关闭SFTP客户端和SSH客户端  
sftp.close()  
ssh.close()